package com.tinfeng.oop;

public class SubDog extends SuperJavaExtends {
    private float weight;

    public SubDog(String name) {
        // 利用super调父类
        super(name);
        System.out.println("小狗被创建");
    }

    public SubDog() {

    }

    public float getWeight() {
        return weight;
    }

    public void setWeight(float weight) {
        this.weight = weight;
    }

    public void run() {
        System.out.println(this.getWeight()+" 在奔跑");
    }

    public static void main(String[] args) {
        SubDog subDog = new SubDog();
        subDog.setName("鸡儿");
        subDog.eat();
        subDog.setWeight(5.2f);
        subDog.run();
        // 调用
        SubDog 花花 = new SubDog("花花");
    }
}
